package com.leyou.search.controller;

import com.leyou.common.bean.Result;
import com.leyou.search.entity.SearchRequest;
import com.leyou.search.entity.SearchResult;
import com.leyou.search.service.SearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zqq
 * @ClassName SearchController
 * @Description: 搜索商品接口
 * @date 2020/3/8-20:18
 */
@RestController
@RequestMapping("search")
@Api(value = "SearchController",description = "搜索商品接口")
public class SearchController {

    @Autowired
    private SearchService searchService;

    @PostMapping("page")
    @ApiOperation(value = "首页搜索商品接口", notes = "首页搜索商品接口")
    public Result<SearchResult> search(@RequestBody SearchRequest request) {
        return this.searchService.search(request);
    }

}
